home *** CD-ROM | disk | FTP | other *** search
- // mydlg.h - display server sample code
- //
- // This is a part of the MetaKit library.
- // Copyright (c) 1996 Meta Four Software.
- // All rights reserved.
- /////////////////////////////////////////////////////////////////////////////
-
- class CServer : public CSocket
- {
- public:
- typedef void (*ConnectHandler)(CFile&);
-
- CServer (int port_, ConnectHandler handler_);
- ~CServer ();
-
- virtual void OnAccept(int error_);
- virtual void OnClose(int error_);
-
- private:
- int _port;
- ConnectHandler _handler; // called when a new connection is opened
- };
-
- // CMyDlg dialog
-
- class CMyDlg : public CDialog
- {
- // Construction
- public:
- CMyDlg (CWnd* pParent = NULL); // standard constructor
- ~CMyDlg ();
-
- // Dialog Data
- //{{AFX_DATA(CMyDlg)
- enum { IDD = IDD_CATRECV_DIALOG };
- CEdit m_port;
- //}}AFX_DATA
-
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMyDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
- // Implementation
- protected:
- int _timer;
- CServer* _server;
-
- // Generated message map functions
- //{{AFX_MSG(CMyDlg)
- virtual BOOL OnInitDialog();
- afx_msg void OnChangePort();
- afx_msg void OnTimer(UINT nIDEvent);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
-
- /////////////////////////////////////////////////////////////////////////////
- // $Id: mydlg.h,v 1.2 1996/12/04 14:49:48 jcw Exp $
-